
import React from 'react';
import Topics from "./Topics";
import { Pagination } from 'antd';
import './antd.css';
import classNames from "classnames";

export class Main extends React.Component{
    constructor(props) {
        super(props);
        this.state={
            page: 1,
            pageSize: 20
        }
    }
    render() {
        return (
            <div className={classNames("inner no-padding")}>
                <Topics page={this.state.page} pageSize={this.state.pageSize}/>
                <Pagination defaultCurrent={1} total={500} onChange={this.onChange}/>
            </div>
        );
    }

    onChange = (pageNumber)=> {
        this.setState({
            page: pageNumber,
            pageSize: 20
        });
    }
}
